From 6c6d249dd5cbaecc415c2c9e2831201c4793ecc2 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Fri, 13 Jun 2008 13:47:28 +0100 Subject: [PATCH] 32-on-64: Fix error handling for XENMEM_decrease_reservation. Signed-off-by: Keir Fraser --- xen/common/compat/memory.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/xen/common/compat/memory.c b/xen/common/compat/memory.c index 491a9ce568..17519f5688 100644 --- a/xen/common/compat/memory.c +++ b/xen/common/compat/memory.c @@ -250,7 +250,7 @@ int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE(void) compat) case XENMEM_decrease_reservation: case XENMEM_populate_physmap: end_extent = split >= 0 ? rc : cmd >> MEMOP_EXTENT_SHIFT; - if ( op != XENMEM_decrease_reservation && + if ( (op != XENMEM_decrease_reservation) && !guest_handle_is_null(nat.rsrv->extent_start) ) { for ( ; start_extent < end_extent; ++start_extent ) @@ -276,13 +276,14 @@ int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE(void) compat) break; } } - - /* Bail if there was an error. */ - if ( (split >= 0) && (end_extent != nat.rsrv->nr_extents) ) - split = 0; } else + { start_extent = end_extent; + } + /* Bail if there was an error. */ + if ( (split >= 0) && (end_extent != nat.rsrv->nr_extents) ) + split = 0; break; case XENMEM_exchange: -- 2.30.2